package com.eshipenet.shipnet.equipmentdatahub

import play.api.libs.json.{Format, Json}

import scala.util.Try

object EquipmentModelDatumSchema {

  implicit val format: Format[EquipmentModelDatumSchema] = Json.format[EquipmentModelDatumSchema]

}

case class EquipmentModelDatumSchema(dataType: String, edgeChannelId: Option[String]) {
  def isUsing(id: String): Boolean = edgeChannelId.contains(id)

  lazy val dataTypeObject: Try[DataType] = DataType.parse(dataType)
}
